package com.fubang.pathlearning.path.rankview;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import com.fubang.pathlearning.R;

import java.util.ArrayList;

public class RankChartActivity extends AppCompatActivity {

    private RankView mChartiew;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_chart);
        mChartiew = (RankView) findViewById(R.id.chart);
        final ArrayList<Float> floats = new ArrayList<>();
        floats.add(54f);
        floats.add(10f);
        floats.add(1f);
        floats.add(3f);
        floats.add(58f);
        floats.add(40f);
        floats.add(73f);
        floats.add(40f);
        floats.add(11f);
        floats.add(132f);
        mChartiew.setList(floats);
        mChartiew.setListener(new RankView.getNumberListener() {
            @Override
            public void getNumber(int number, int x, int y) {
                Toast.makeText(RankChartActivity.this,String.valueOf(floats.get(number)),Toast.LENGTH_SHORT).show();
            }
        });
    }
}
